import { RequestHandle, searchTrials } from "@/api/resman";
import { useRef } from "react";

export const CustomInfos = {
	trial: () => {
		// const values = [];
		const values = useRef(null);
		searchTrials().then(res => {
			RequestHandle({
				res,
				success: data => {
					// console.log(data);
					const items = data.items;
					items &&
						items.map(item => {
							values.push({
								value: item.sid,
								label: item.name
							});
						});

					values.current = items;
				}
			});
		});
		console.log(values);

		// return values;
	}
};
